<template>
  <div id="app">
   
   <router-view/>
	<van-tabbar route v-if="isShow">
	  <van-tabbar-item replace to="/home" icon="home-o">首页</van-tabbar-item>
	  <van-tabbar-item replace to="/project" icon="search">专题</van-tabbar-item>
	  <van-tabbar-item replace to="/cation" icon="home-o">分类</van-tabbar-item>
	  <van-tabbar-item replace to="/cart" icon="search">购物车</van-tabbar-item>
	  <van-tabbar-item replace to="/my" icon="home-o">我的</van-tabbar-item>
	</van-tabbar>
  </div>
</template>
<script>
	
	
	export default {
		data(){
			return{
				isShow:false
			}
		},
		watch:{
			"$route":function(to,from){
				var arr = ["/home","/project","/cation","/cart","/my"]
				if(arr.includes(to.path)){
					this.isShow = true
				}else{
					this.isShow = false
				}
			
			}
		},
		created () {
		   var userInfo = {
		
		    "openId":"18291779294",
		
		    "nickName":"冯翊",
		
		    "avatarUrl":"https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIbWFEIJj8IpGeHM7dGic1aTFZALjWcMm9ltWfFiaQfVRYticWBfgGfzXWMt2EkJWiaicPtftHAlWxUibxQ/132"
		
		  };
		
		  var openId = userInfo.openId;
		
		  localStorage.setItem("userInfo", JSON.stringify(userInfo));
		
		  localStorage.setItem("openId", openId);
		}
	}
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
}

.Info-img{
	img{
		width: 375px;
		
	}
}
</style>
